<template>
		<view class="pl25 pr25" style="background-color: #FFFFFF;padding-bottom: 20rpx;">
			
			<textarea class="block w100 pad20 box" placeholder="请输入您的意见或建议！" v-model="content"></textarea>
			<!-- <view class="bottomBtn ftc">
				<view class="bottomBtncon bgfff"><text class="cfff btns ct ftc block" @click="submit()">提交</text></view>
			</view> -->
			<view class="pad20" style="color: #AAAFAF;">感谢你为我们提供宝贵的建议，我们会认真分析， 切实解决！愿我们共同成长，最后祝你身体健康！</view>
			<view style="width: 100%;position: fixed;bottom: 40rpx;display: flex;align-items: center;justify-content: space-around;left: 0;">
				<view class="add-btn"  @click="submit">提交</view>
			</view>
			<uni-popup ref="popup" type="message">
			    <uni-popup-message :type="warnType" :message=warnMessage :duration="warnTime"></uni-popup-message>
			</uni-popup>
		</view>
</template>

<script>
	export default {
		data() {
			return {
				warnMessage:'错误',//消息内容
				warnType:'warn',//消息类型  success/warn/info/error
				warnTime:1000,//消息提醒延长时间
				userId:'',
				content:''
			};
		},
		onLoad(option) {
			this.userId = option.userId;
		},
		onShow() {
			
		},
		methods: {
			submit(){
				var that = this;
				var usrUserId = that.userId;//用户id
				var content = that.content;//反馈内容
				uni.showModal({
				    title: '提示',
				    content: '是否确定提交反馈信息',
				    success: function (res) {
				        if (res.confirm) {
				            uni.request({
								
				            	url:'https://app.mzmzb.com/application-usrapp/usrFeedBack/submitFeedBack.tz?usrUserId='+usrUserId+'&content='+content+'&hspId=1651',
				            	// data: {usrUserId : usrUserId,content:content,hspId:'23840'},
				            	method:"POST",
				            	success: (item) => {
									if(item.data.success){
										that.warnMessage = '提交成功';
										that.warnType = 'success';
										that.$refs.popup.open();
									}
				            	},
				            	fail(error) {
									
				            	},
								complete() {
									setTimeout(()=>{
										//首页我的跳转
										uni.reLaunch({
											url: '/pages/user/index'
										});
									},1500)
								}
				            })
				        } else if (res.cancel) {
				            
				        }
				    }
				});
			}
		}
	};
</script>

<style lang="less">
	textarea {
		height: 300rpx;
		border-radius: 5rpx;
		border: 1rpx solid #efefef;
	}
	.add-btn{
		margin: auto;
		height: 88rpx;
		line-height: 88rpx;
		width: 90%;
		background: #BE965B;
		border-radius: 44rpx;
		color: #FFFFFF;
		text-align: center;
	}
	.bottomBtn {
		position: relative;
		height: 125rpx;
		width: 100%;
		.bottomBtncon {
			position: fixed;
			width: 100%;
			z-index: 10;
			left: 0;
			height: 125rpx;
			bottom: 0;
			background: #ffffff;
			.btns {
				width: 660rpx;
				height: 100rpx;
				line-height: 100rpx;
				border-radius: 10rpx;
				background: #74a6fd;
			}
		}
	}
</style>
